Stored routines (procedures and functions) are supported in MySQL 5.0. A stored routine is a set of SQL statements that can be stored in the server. Once this has been done, clients do not need to keep reissuing the individual statements but can refer to the stored routines instead.
Just simply click to open an object pane for Function. By using the object pane
toolbar below, you can create new, edit and delete the selected function.
Create Function/Procedure
To create a new function/procedure
- Select anywhere on the object pane.
- Click the
from the object pane toolbar.
or - Control-click and select New Function from the popup menu.
- Edit function/procedure properties on the appropriate tabs of the Function/Procedure Designer.
Hint: To create new function/procedure you can also control-click the Functions node of the navigation pane and select New Function from the popup menu.
To create a new function/procedure with the same properties as one of the existing function/procedure has (using drag and drop method)
Apply to: current database {same connection}
- Select the function/procedure(s) for copying in the navigation pane/object pane.
- Click and drag the chosen function/procedure(s) to the target location.
- Select one of the following options:
- Copy
- Cancel
- The newly created function/procedure(s) will be named as "function/procedurename_copy".
Apply to: different database {same connection} different database {different connection} (Data Transfer tool will be activated)
To create a new function/procedure with the same properties as one of the existing function/procedure has
- Select the function/procedure(s) for copying in the object pane.
- Drag and drop the chosen function/procedure(s) to the target database.
- Select one of the following options:
- Copy
- Cancel
- Control-click the function/procedure in the navigation pane or object pane and choose Duplicate Function.
- The newly created function/procedure will be named as "function/procedurename_copy".
To create a new function/procedure with modification as one of the existing function/procedure
- Select the function/procedure for modifying in the navigation pane/object pane.
- Control-click and select Design
Function from the popup menu or simply double-click the function/procedure.
or - Click the
from the object pane toolbar.
- Modify function/procedure properties on the appropriate tabs of the Function Designer.
- Click
Save As.
To edit the existing function/procedure (manage its definition etc)
- Select the function/procedure for editing in the navigation pane/object pane.
- Control-click and select Design Function
from the popup menu or simply double-click the function/procedure.
or - Click the
from the object pane toolbar.
- Edit function/procedure properties on the appropriate tabs of the Function Designer.
To change the name of the function/procedure
- Select the function/procedure for editing in the navigation pane/object pane.
- Control-click and select the Rename from the popup menu.
Run Function/Procedure
To run a function/procedure in the navigation pane/object pane
- Select the function/procedure for executing in the navigation pane/object pane.
- Click the Execute from the object pane toolbar.
or - Control-click and select Execute Function from the popup menu.
- View/edit the returned data on the Result tab.
To run a function/procedure in the Function/Procedure Designer
- Create a new function/procedure or open the existing function/procedure.
- Click
Execute.
- View/edit the returned data on the Result tab.
Delete Function/Procedure
To delete a function/procedure
- Select the function/procedure for deleting in the navigation pane/object pane.
- Control-click and select the Delete Function
from the popup menu.
or - Click the
from the object pane toolbar.
- Confirm deleting in the dialog window.
Achieve Function/Procedure Information
To achieve a function/procedure information
- Select the function/procedure in the navigation pane/object pane.
- Choose View -> Object Information in the main menu.
or - Click the
from the object pane toolbar.